####
#Set-HostFile
#Created by 
#Nate Bruneau / IS Engineering
####

Write-Host -ForegroundColor Yellow "Host-File: Adding Host file for $env:farmname."

	$hostfilepath = "$env:systemdrive\Windows\System32\drivers\etc\hosts";
	$hostfile = Get-Content $hostfilepath

		if ($hostfile -like "*$env:farmname*"){
		
		#Write-Host "Host-File has already been added to $server"
		} else {
		Write-Host "Adding Host file entry for $env:farmname to $server"
		Add-Content $hostfilepath "127.0.0.1		$env:farmname"
		}
		
Write-Host -ForegroundColor Yellow "Host-File: Adding Host file for $env:farmname. : COMPLETED"

